package springProvider;

import java.io.UnsupportedEncodingException;
import java.util.Scanner;

import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.messaging.Processor;
import org.springframework.cloud.stream.messaging.Source;
import org.springframework.scheduling.annotation.EnableScheduling;

import springProvider.message.ReceiveService;



@SpringBootApplication
@EnableEurekaClient
@EnableScheduling
//@EnableBinding(value= {ReceiveService.class,Processor.class})
public class ProviderFirst {
	@SuppressWarnings("resource")
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String port = scan.nextLine();
		String ports[] = port.split(",");
		new SpringApplicationBuilder(ProviderFirst.class).properties ("server.port="+ports[0],"grpc.server.port="+ports[1]).run(args);
	}
	
//	@StreamListener("myInput")
//	public void receive(byte[] msg) throws UnsupportedEncodingException {
//		System.out.println("provider 端接收到消息"+new String(msg,"utf-8"));
//	}
	
	 
}
